import {
	mapGetters
} from 'vuex'
export default {
	computed: {
		...mapGetters('m_cart', ['total'])
	},
	watch: {
		total() {
			this.setBarBadge()
		},
	},
	onShow() {
		this.setBarBadge()
	},
	methods: {
		/* 
		 为tabBar设置右上角的图标
		 */
		setBarBadge() {
			uni.setTabBarBadge({
				index: 2,
				text: this.total + ''
			})
		}
	}
}